package team.southcat.wsyygh.common.util;

import javax.servlet.http.HttpServletRequest;

public class UserInfoUtil {

    public static String getUserId(HttpServletRequest request) {
        //从header获取token
        String token = request.getHeader("token");
        if (token == null){
            token = request.getHeader("Token");
        }
        if (token == null){
            return null;
        }
        //jwt从token获取userid
        String userId = JwtUtil.getUserId(token);
        return userId;
    }
}
